﻿using System;
using System.Net;
using System.ComponentModel;

namespace KKSGameLibrary.Logic
{
    public class GamePlayer:INotifyPropertyChanged
    {
        public GamePlayer(string playerid, string playername)
        {
            ID = playerid;
            Name=playername;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        void onPropertyChanged(string propertyname)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this,
                    new PropertyChangedEventArgs(propertyname));
            }
        }

        public string ID {internal set; get; }
        public string Name {internal set; get; }

        int ownedregioncount;
        public int OwnedRegionCount
        {
            internal set{
                if (ownedregioncount != value)
                {
                    ownedregioncount = value;
                    onPropertyChanged("OwnedRegionCount");
                }
            }
            get{
                return ownedregioncount;
            }
        }

        int puppetremain;
        public int PuppetRemain
        {
            internal set
            {
                if (puppetremain != value)
                {
                    puppetremain = value;
                    onPropertyChanged("PuppetRemain");
                }
            }
            get
            {
                return puppetremain;
            }
        }

        int score;
        public int Score
        {
            internal set
            {
                if (score != value)
                {
                    score = value;
                    onPropertyChanged("Score");
                }
            }
            get
            {
                return score;
            }
        }
    }
}
